package com.ljtg.ljtgservice.mapper;

import com.github.pagehelper.Page;
import com.ljtg.enumeration.OperationType;
import com.ljtg.ljtgpojo.dto.CategoryDTO;
import com.ljtg.ljtgpojo.dto.CategoryPageQueryDTO;
import com.ljtg.ljtgpojo.entity.Category;
import com.ljtg.ljtgservice.annotation.AutoFill;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface CategoryMapper {

    @AutoFill(value = OperationType.INSERT)
    void insert(Category category);

    void update(Category category);

    @Delete("DELETE FROM category WHERE id=#{id}")
    void deleteById(Long id);

    Page<Category> PageQuery(CategoryPageQueryDTO categoryPageQueryDTO);

    //查询所有分类
    @Select("Select * from category")
    List<Category> list( );
}